@import 'src/styles/const.scss';

$height: 50px;

.fd-form-grid-cell {
  box-sizing: border-box;
  position: relative;
  width: 100%;

  &-selectionleft,
  &-selectionright,
  &-selectiontop,
  &-selectionbottom {
    position: relative;
    &:after {
      content: '';
      position: absolute;
      top: -1px;
      left: -1px;
      bottom: -1px;
      right: -1px;
      z-index: 1;
      height: calc(100% + 2px);
      width: calc(100% + 2px);
    }
  }
  &-selectionleft {
    &:after {
      border-left: 2px solid #018aff;
    }
  }
  &-selectionright {
    &:after {
      border-right: 2px solid #018aff;
    }
  }
  &-selectiontop {
    &:after {
      border-top: 2px solid #018aff;
    }
  }
  &-selectionbottom {
    &:after {
      border-bottom: 2px solid #018aff;
    }
  }
  &-selectionbg {
    background-color: rgba(3, 164, 256, 0.6);
  }
  &-tool {
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: #ffffff;
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    color: $color-danger;
    display: none;
  }
  &:hover .fd-form-grid-cell-tool {
    display: block;
  }
  &.form-dnd-drag {
    opacity: 0.5;
  }
  &.form-dnd-enter:before,
  &.form-dnd-over:before {
    content: '';
    background-color: $color-danger;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 9998;
  }

  &.form-dnd-enter:after,
  &.form-dnd-over:after {
    content: '松开鼠标，添加元素';
    color: #ffffff;
    position: absolute;
    text-align: center;
    font-size: 14px;
    width: 100%;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -12px;
    z-index: 9999;
    height: 24px;
    line-height: 24px;

    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }
  .el-form-item {
    margin: 0 !important;
  }
}

.fd-form-grid-cell-empty {
  text-align: center;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -8px;
  line-height: 16px;
  height: 16px;
  user-select: none;
  color: $text-second;
}
